<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>客户评价</title>
	<!-- Stylesheets -->
	<link href="static/css/bootstrap.css" rel="stylesheet">
	<link href="static/css/revolution-slider.css" rel="stylesheet">
	<link href="static/css/style.css" rel="stylesheet">

	<!--Favicon-->
	<link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
	<link rel="icon" href="static/images/favicon.ico" type="image/x-icon">

	<!-- Responsive -->
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link href="static/css/responsive.css" rel="stylesheet">
	<script type="text/javascript" src="static/jquery/jquery-2.1.1.min.js"></script>
	<style>
		ul.pagination {
			display: inline-block;
			padding: 0;
			margin: 0;
		}

		ul.pagination li {display: inline;}

		ul.pagination li a {
			color: black;
			float: left;
			padding: 8px 16px;
			text-decoration: none;
			transition: background-color .3s;
			border: 1px solid #ddd;
		}

		.pagination li:first-child a {
			border-top-left-radius: 5px;
			border-bottom-left-radius: 5px;
		}

		.pagination li:last-child a {
			border-top-right-radius: 5px;
			border-bottom-right-radius: 5px;
		}

		ul.pagination li a.active {
			background-color: #4CAF50;
			color: white;
			border: 1px solid #4CAF50;
		}

		ul.pagination li a:hover:not(.active) {background-color: #ddd;}
	</style>
</head>


<body>
<div class="page-wrapper">

	<header class="header" id="header"></header>
	<script type="text/javascript">
		/*引入Header部分公共代码*/
		//登录成功回显用户信息
		$(function(){
			$("#header").load('header.html',function () {
				$.ajax({
					type:"post",
					url:"getUserBySession",
					contentType: "application/json; charset=utf-8",
					async:true,
					success:function(data){
						console.log(data.username)
						if (data.username ===undefined) {
							//$(".userIcon").text(data.username)
						}else {
							//console.log("ttttttt"+data.username);

							$(".userIcon").text(data.username);
							$(".userReg").css("display","none");
							$(".userLog").text("切换用户");
						}
					},
					error: function (xhr) {
						alert("异常");
					}
				});
			})
		});
	</script>


	<!-- main header area end -->

	<!--Page Title-->
	<section class="page-title text-center">
		<div class="auto-container">
			<div class="content-box">
				<div class="title">客户评价</div>
				<ul class="bread-crumb">
					<li><a href="index.html">主页<i class="fa fa-angle-right"></i></a></li>
					<li>客户评价</li>
				</ul>
			</div>
		</div>
	</section>
	<!--End Page Title-->

	<!-- testimonials-page section -->
	<section class="testimonials-section testimonials-page">
		<div class="container">
			<div style="width: 60%; margin: auto">
				<div style="Float:left;width: 85%">
					<textarea id="textarea" class="textarea" placeholder="请输入您对陌陌酒店平台的评价" style="width: 100%; height: 125px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;resize:none"></textarea>
				</div>
				<div class="box-footer clearfix">
					<button style="margin-top: 85px" type="button" class="pull-right btn btn-default" id="addTestimonials">评价
						<i class="fa fa-arrow-circle-right"></i></button>
				</div>
			</div>
			<div class="row" id="testimonials">
				<!-- 客户评价信息 -->
			</div>
			<div style="text-align: center">
				<ul class="pagination">
					<li><a href="#">«</a></li>
					<li><a class="active"  href="#">1</a></li>
					<li><a href="#">2</a></li>
					<li><a href="#">3</a></li>
					<li><a href="#">4</a></li>
					<li><a href="#">5</a></li>
					<li><a href="#">»</a></li>
				</ul>
			</div>
		</div>
	</section>
	<!-- testimonials section end -->

	<!--页眉-->
	<div class="footer" id="footer" ></div>
	<script type="text/javascript">
        /*引入Header部分公共代码*/
        $(function(){
            $.ajax({
                type:"get",
                url:"footer.html",
                async:true,
                success:function(data){
                    $("#footer").html(data);
                }
            });
        });
	</script>

	<script>
        $("#addTestimonials").bind("click", function () {
            $.ajax({
                //提交数据的类型 POST GET
                type: "POST",
                //提交的网址
                url: "addTestimonials",
                data: {
                    "textarea": $("#textarea").val()
                },
                success: function (returnData) {
                    if (returnData == "请登陆"){
                        alert(returnData);
                        window.location.href = 'login1.html';
                    }else if (returnData == "评论内容不能为空" || returnData == "评价失败") {
                        alert(returnData);
                    }else if(returnData == "评价成功"){
                        alert(returnData);
                        window.location.reload()
					}
                },
                //调用出错执行的函数
                error: function (responseText) {
                    //请求出错处理
                    console.error(responseText);
                }
            });
        });
	</script>

	<script>
        $(function () {
            $.ajax({
                //提交数据的类型 POST GET
                type:"POST",
                //提交的网址
                url:"selectTestimonials",
                dataType:"json",
                //成功返回之后调用的函数
                contentType:"application/json",
                success:function(returnData){
                    $.each(returnData,function (i, value) {
                            $("#testimonials").append("<div class=\"col-md-4 col-sm-6 col-xs-12\">\n" +
                                "\t\t\t\t\t<div class=\"testimonial-autor\">\n" +
                                "\t\t\t\t\t\t<div class=\"img-box\">\n" +
                                "\t\t\t\t\t\t\t<figure><img style=\"width: 65px;height: 65px\" src=\"/static/upload/"+value.photo+"\" alt=\"\"></figure>\n" +
                                "\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t\t<div class=\"autor-content\">\n" +
                                "\t\t\t\t\t\t\t<h4>"+value.username+"</h4>\n" +
                                "\t\t\t\t\t\t\t<span>&nbsp;</span>\n" +
                                "\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t<div class=\"single-item\" style=\"margin-top: 20px\">\n" +
                                "\t\t\t\t\t\t<div class=\"text\">\n" +
                                "\t\t\t\t\t\t\t"+value.content+"\n" +
                                "\t\t\t\t\t\t</div>\n" +
                                "\t\t\t\t\t</div>\n" +
                                "\t\t\t\t</div>")
                });
                },
                //调用出错执行的函数
                error: function(responseText){
                    //请求出错处理
                    console.error(responseText);
                }
            });
        })
	</script>


</div>
<!--End pagewrapper-->


<!--Scroll to top-->
<div class="scroll-to-top scroll-to-target" data-target=".main-header"><span class="icon fa fa-angle-up"></span></div>



<!-- jQuery js -->

<script src="static/js/map-script.js"></script>
<script type="text/javascript" src="static/js/jquery-2.1.4.js"></script>
<script src="static/js/bootstrap.min.js"></script>
<script src="static/js/jquery.themepunch.tools.min.js"></script>
<script src="static/js/jquery.themepunch.revolution.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.slideanims.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.layeranimation.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.navigation.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.kenburn.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.actions.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.parallax.min.js"></script>
<script type="text/javascript" src="static/js/revolution.extension.migration.min.js"></script>
<script type="text/javascript" src="static/js/jquery.fancybox.pack.js"></script>
<script type="text/javascript" src="static/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="static/js/owl.carousel.min.js"></script>
<script type="text/javascript" src="static/js/jquery.appear.js"></script>
<script type="text/javascript" src="static/js/jquery.countTo.js"></script>
<script src="static/js/isotope.js"></script>
<script src="static/js/jquery.fancybox.pack.js"></script>
<script src="static/js/jquery.fancybox-media.js"></script>
<script src="static/js/owl.js"></script>
<script src="static/js/masterslider.js"></script>
<script type="text/javascript" src="static/js/jquery.polyglot.language.switcher.js"></script>
<script src="static/js/owl.carousel.min.js"></script>
<script type="text/javascript" src="static/js/jquery.mixitup.min.js"></script>
<script src="static/js/validate.js"></script>
<script src="static/js/wow.js"></script>
<script src="static/js/script.js"></script>
<script type="text/javascript" src="static/js/theme.js"></script>

<script src="static/js/timePicker.js"></script>
<script src="static/js/jquery-ui.js"></script>

<script src="static/js/validation.js"></script>


<!-- End of .page_wrapper -->

</body>
</html>
